<template>
	<view :class="[`${PREFIX}`]">
		<textarea name="" id="" cols="30" rows="10" placeholder="请输入举报内容" @input="change"></textarea>
		<view :class="[`${PREFIX}-tip1`]">还可输入{{ restLength }}个字</view>
		<view :class="[`${PREFIX}-tip2`]">图片证据-必须提供（最多9张）</view>
		<image src="" mode="" @click="chooseImg"></image>
		
		<view @click="publish">
			发布
		</view>
	</view>
</template>

<script>
	const PREFIX = 'home-material'
	export default{
		data(){
			return {
				PREFIX,
				restLength: 1000,
				imgList: []
			}
		},
		methods: {
			change(e){
				let value = e.detail.value
				this.restLength = 1000 - value.length
			},
			chooseImg () {
				uni.chooseImage({
					count:9,
					success: ({tempFilePaths}) => {
						console.log(tempFilePaths);
						this.imgList = this.imgList.concat(tempFilePaths)
					}
				})
			},
			publish(){
				uni.redirectTo({
					url: '/pages/home/reportRes'
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background: #fff;
	}
	.home-material {
		padding: 0 34rpx;
		textarea {
			padding-top: 20rpx;
		}
		&-tip1 {
			 height: 50rpx;
			 line-height: 50rpx;
			 color: #999999;
			 text-align: right;
			 font-size: 36rpx;
		}
		&-tip2 {
			 height: 50rpx;
			 line-height: 50rpx;
			 color: #000000;
			 text-align: left;
			 font-size: 36rpx;
			 margin-top: 22rpx;
		}
		image {
			width: 154rpx;
			height: 154rpx;
			background: blue;
			margin-top: 18rpx;
		}
	}
</style>